import requests
import config


class RegAPI:

    # 实例化session对象
    session = requests.Session()

    # 获取图片验证码
    def get_img_code(self, r):
      return RegAPI.session.get(url=config.BASE_URL + f"/common/public/verifycode1/{r}")

    # 获取短信验证码
    def get_sms_code(self, test_data):
      return RegAPI.session.post(url=config.BASE_URL + f"/member/public/sendSms", data=test_data)

    # 登录
    def login(self, test_data):
      return RegAPI.session.post(url=config.BASE_URL + f"/member/public/login", data=test_data)